<template>
  <div class='rate'>
    <span>☆☆☆☆☆</span>
    <span class='solid'
          :style='style'>★★★★★</span>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  computed: {
    style () {
      return `width:${this.value / 2}em`
    },
    aa () {
      return typeof this.value
    }
  }
}
</script>

<style lang='scss'>
.rate {
  display: inline-block;
  position: relative;
  font-size: 12px;
  .solid {
    position: absolute;
    display: inline-block;
    top: 0;
    left: 0;
    width: 0;
    overflow: hidden;
  }
}
</style>
